package com.hongyue.ziXI;

import java.util.*;

public class Demo02 {
    public static void main(String[] args) {
        HashMap<Integer, String> is = new HashMap<>();
        String[] hua = {"♦", "♣", "♠", "♥"};
        String[] zi = {"3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A", "2"};
        int a = 1;
        for (int i = 0; i < zi.length; i++) {
            for (int i1 = 0; i1 < hua.length; i1++) {
                String s = zi[i];
                is.put(a, hua[i1] + s);
                a++;
            }
        }
        is.put(53, "joker");
        is.put(54, "JOKER");
        ArrayList<Integer> a1 = new ArrayList<>();
        ArrayList<Integer> a2 = new ArrayList<>();
        ArrayList<Integer> a3 = new ArrayList<>();
        ArrayList<Integer> 底牌 = new ArrayList<>();
        ArrayList<Integer> paiku = new ArrayList<>();
        for (int i = 0; i < 54; i++) {
            paiku.add(i + 1);
        }
        Collections.shuffle(paiku);
        for (int i = 0; i <= 50; i++) {
            if (i % 3 == 0) {
                a1.add(paiku.get(i));
            } else if (i % 3 == 1) {
                a2.add(paiku.get(i));
            } else {
                a3.add(paiku.get(i));
            }
        }
        底牌.add(paiku.get(52));
        底牌.add(paiku.get(53));
        底牌.add(paiku.get(51));
        a1.sort((o1, o2) -> o1 - o2);
        a2.sort((o1, o2) -> o1 - o2);
        a3.sort((o1, o2) -> o1 - o2);
        ArrayList 周韵发 = zhuanHuan(a1, is);
        ArrayList 周星驰 = zhuanHuan(a2, is);
        ArrayList 刘德华 = zhuanHuan(a3, is);
        ArrayList dp = zhuanHuan(底牌, is);
        System.out.println("周韵发 = " + 周韵发);
        System.out.println("刘德华 = " + 刘德华);
        System.out.println("周星驰 = " + 周星驰);
        System.out.println("dp = " + dp);
    }

    private static ArrayList zhuanHuan(ArrayList<Integer> a, HashMap<Integer, String> s) {
        ArrayList<String> arr = new ArrayList<>();
        for (int i = 0; i < a.size(); i++) {
            String s1 = s.get(a.get(i));
            arr.add(s1);
        }
        return arr;
    }
}
